package arina.university.model;

import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: user
 * Date: 15.11.13
 * Time: 13:56
 * To change this template use File | Settings | File Templates.
 */
public class University {
    private String name;
    private List<Group> groups = new ArrayList<Group>();

    public University(String name) {
        this.name = name;
    }

    public long getQuantity() {
        long q = 0;
        for (Group g : groups) {
            q += g.getQuantity();
        }
        return q;
    }


    public void setName(String name){
        this.name=name;
    }

    public void addGroup(Group group) {
        this.groups.add(group);
    }

    public void deleteGroup(Group group){
        this.groups.remove(group);
    }

    public String getName() {
        return name;
    }

    public Collection<Group> getGroups() {
        return groups;
    }


}
